Skip to content

London | 26-ITP-May | Martin Mwaka | Sprint 1 | Exercises#1234

Open
Temceo wants to merge 13 commits into
CodeYourFuture:mainfrom
Temceo:coursework/sprint-1
Open

London | 26-ITP-May | Martin Mwaka | Sprint 1 | Exercises#1234
Temceo wants to merge 13 commits into
CodeYourFuture:mainfrom
Temceo:coursework/sprint-1

Conversation

@Temceo

@Temceo Temceo commented Jul 6, 2026

Copy link
Copy Markdown

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Changelist

I have completed all exercises, including stretch, in sprint 1

@Temceo Temceo added 🏕 Priority Mandatory This work is expected 🏝️ Priority Stretch Do this once mandatory work is done Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Data-Groups The name of the module. labels Jul 6, 2026

@LonMcGregor LonMcGregor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work on these tasks, there are a couple where I have some questions to check your ideas behind what you've written

Comment thread Sprint-1/fix/median.js Outdated

// filter only numbers from array and sort the filtered array. If no numbers return null
const numbers = list
.filter((item) => typeof item === "number" && Number.isFinite(item))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you checking isFinite here?

@Temceo Temceo Jul 16, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't need isFinite here because by this stage non numbers have been filtered out. I have removed it.

Comment thread Sprint-1/implement/dedupe.js Outdated
// return empty array if empty input
if (array.length === 0) return [];
// check if array has duplicates
const hasDuplicates = new Set(array).size !== array.length;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know how a set works? Is it necessary to check for hasDuplicated here?

@Temceo Temceo Jul 16, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, on review, I can just return the set as it will either remove duplicates or give me the original array. I have refactored this to a single line

Comment thread Sprint-1/implement/sum.js
// filter out the numbers and sum them up
return elements
.filter((item) => Number.isFinite(item))
.reduce((acc, num) => acc + num, 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of chaining higher order functions together

@LonMcGregor LonMcGregor added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Jul 13, 2026
@Temceo Temceo added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Data-Groups The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🏕 Priority Mandatory This work is expected 🏝️ Priority Stretch Do this once mandatory work is done

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants